/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 artifact_prop_fragment.h

	$Header: /heroes4/artifact_prop_fragment.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ARTIFACT_PROP_FRAGMENT_H_INCLUDED )
#define ARTIFACT_PROP_FRAGMENT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "artifact_prop_effect.h"

enum t_artifact_type;

namespace t_artifact_prop
{
	// ----------------------------------------------------------------------
	// class for pieces of an artifact
	// ----------------------------------------------------------------------
	class t_fragment : public t_base<k_artifact_effect_fragment>
	{
	public:
		t_fragment();
		t_fragment( t_artifact_type result, int pieces );

		virtual bool				accept( t_artifact_effect_visitor& visitor );
		virtual t_artifact_effect*	clone() const;
		static t_artifact_effect*	create();
		int                         get_pieces() const;
		t_artifact_type				get_result() const;
		virtual bool				read( std::streambuf& buffer );
		virtual bool				write( std::streambuf& buffer ) const;
	protected:
		t_artifact_type m_whole;
		int				m_pieces;
	};

	inline t_fragment::t_fragment()
	{
	}

	inline t_fragment::t_fragment( t_artifact_type result, int pieces )
	{
		m_whole = result;
		m_pieces = pieces;
	}

	inline t_artifact_type t_fragment::get_result() const
	{
		return m_whole;
	}

	inline int t_fragment::get_pieces() const
	{
		return m_pieces;
	}
};

#endif // ARTIFACT_PROP_FRAGMENT_H_INCLUDED